﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DBLibrary.Model.pojo
{
    public class SensorDict
    {
        private int id;
        private string sensorType;
        private int sensorCode;
        private string sensorName;
        private string unit;
        private int isAnalog;
        private int lowLimit;
        private int highLimit;
        private int computeMethod;//1 原始数值 2 频率解析 3 分段解析
        private int isNegative;
        private int digitals;
        private int baseValue;
        private float cofficent;
        private string openLabel;
        private string stopLabel;
        public SensorDict() { }

        public int Id { get => id; set => id = value; }
        public string SensorType { get => sensorType; set => sensorType = value; }
        public int SensorCode { get => sensorCode; set => sensorCode = value; }
        public string SensorName { get => sensorName; set => sensorName = value; }
        public string Unit {
            get
            {
                if (string.IsNullOrEmpty(unit))
                    return "";
                else
                    return unit;
            }
            set => unit = value; }
        public int IsAnalog { get => isAnalog; set => isAnalog = value; }
        public int LowLimit { get => lowLimit; set => lowLimit = value; }
        public int HighLimit { get => highLimit; set => highLimit = value; }
        public int ComputeMethod { get => computeMethod; set => computeMethod = value; }
        public int IsNegative { get => isNegative; set => isNegative = value; }
        public int Digitals { get => digitals; set => digitals = value; }
        public int BaseValue { get => baseValue; set => baseValue = value; }
        public float Cofficent { get => cofficent; set => cofficent = value; }
        public string OpenLabel {
            get
            {
                if (string.IsNullOrEmpty(openLabel))
                    return "";
                else
                    return openLabel;
            }
            set => openLabel = value; }
        public string StopLabel {
            get { 
                if(string.IsNullOrEmpty(stopLabel))
                    return ""; 
                else
                    return stopLabel;
            }
            set => stopLabel = value; }
    }
}
